﻿using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace _14_缓存.Controllers
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class 给客户端添加缓存控制Controller : ControllerBase
    {
        // 客户端不缓存
        [HttpGet]
        public DateTime 没做个缓存处理的()
        {
            return DateTime.Now;
        }
        // 客户端缓存20秒
        [ResponseCache(Duration =20)]
        [HttpGet]
        public DateTime 做过缓存处理的()
        {
            return DateTime.Now;
        }
        

    }
}
